package com.hello.system.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hello.common.core.annotation.Excel;
import com.hello.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户订单对象 sd_orders
 * 
 * @author hello
 * @date 2025-05-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Orders extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID，主键，自增 */
    private Long orderId;

    /** 用户ID，关联系统用户表 */
    @Excel(name = "用户ID，关联系统用户表")
    private Long userId;

    /** 相关联的信件ID（如果有） */
    @Excel(name = "相关联的信件ID", readConverterExp = "如=果有")
    private Long letterId;

    /** 订单日期，默认为当前时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单日期，默认为当前时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderDate;

    /** 订单总金额，不能为空 */
    @Excel(name = "订单总金额，不能为空")
    private BigDecimal totalAmount;

    /** 订单状态 */
    @Excel(name = "订单状态")
    private String status;

    /** 支付方式 */
    @Excel(name = "支付方式")
    private String paymentMethod;

    /** 支付交易ID */
    @Excel(name = "支付交易ID")
    private String paymentTransactionId;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    public void setOrderId(Long orderId) 
    {
        this.orderId = orderId;
    }

    public Long getOrderId() 
    {
        return orderId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setLetterId(Long letterId) 
    {
        this.letterId = letterId;
    }

    public Long getLetterId() 
    {
        return letterId;
    }
    public void setOrderDate(Date orderDate) 
    {
        this.orderDate = orderDate;
    }

    public Date getOrderDate() 
    {
        return orderDate;
    }
    public void setTotalAmount(BigDecimal totalAmount) 
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() 
    {
        return totalAmount;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setPaymentMethod(String paymentMethod) 
    {
        this.paymentMethod = paymentMethod;
    }

    public String getPaymentMethod() 
    {
        return paymentMethod;
    }
    public void setPaymentTransactionId(String paymentTransactionId) 
    {
        this.paymentTransactionId = paymentTransactionId;
    }

    public String getPaymentTransactionId() 
    {
        return paymentTransactionId;
    }
    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }
    public void setUpdatedAt(Date updatedAt) 
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() 
    {
        return updatedAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orderId", getOrderId())
            .append("userId", getUserId())
            .append("letterId", getLetterId())
            .append("orderDate", getOrderDate())
            .append("totalAmount", getTotalAmount())
            .append("status", getStatus())
            .append("paymentMethod", getPaymentMethod())
            .append("paymentTransactionId", getPaymentTransactionId())
            .append("createdAt", getCreatedAt())
            .append("updatedAt", getUpdatedAt())
            .toString();
    }
}
